@import 'sulu-admin-bundle/containers/Application/colors.scss';

$locationMapBorderColor: $alto;
$locationLabelTextColor: $scorpion;
$locationContentBackgroundColor: $alto;
$locationButtonTextColor: $scorpion;
$locationButtonTextColorActive: $white;
$locationButtonBackgroundColor: $alto;
$locationButtonBackgroundColorActive: $shakespeare;
$locationButtonMargin: 2px;

.location-container {
    &.disabled {
        opacity: .5;
        pointer-events: none;
    }
}

.location-header {
    display: flex;
    justify-content: space-between;
    height: 40px;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 10px;
}

.location-header-button {
    width: 40px;
    color: $locationButtonTextColor;
    background-color: $locationButtonBackgroundColor;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    margin-right: $locationButtonMargin;

    &:hover {
        color: $locationButtonTextColorActive;
        background-color: $locationButtonBackgroundColorActive;
    }
}

.location-header-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    height: 100%;
    background-color: $locationContentBackgroundColor;
    font-size: 12px;
    color: $locationLabelTextColor;
    padding: 0 20px;
}

.location-map {
    border-radius: 3px;
    border: 1px solid $locationMapBorderColor;
    height: 200px;

    /* unfortunately leaflet sets a z-index of 400 to its map, that would be higher than the z-index of our overlays */
    z-index: 0;

    /* set width of leaflet containers to allow for setting a relative width to our tooltip */
    :global(.leaflet-map-pane),
    :global(.leaflet-tooltip-pane) {
        width: 100%;
    }

    .location-map-tooltip {
        max-width: 40%;
        white-space: normal;
    }
}
